package com.mjw.tender.api;

import com.mjw.tender.domain.Favourite;

import java.util.List;

public interface FavouriteService {

    /**
     * 点赞文章 resource_type:1 action_type:1
     * 收藏文章 resource_type:1 action_type:2
     * 点赞评论 resource_type:2 action_type:1
     * @param favouriteList
     * @return
     */
    public Long add(Favourite favouriteList);

    /**
     * 根据文章ID 和用户ID查找喜欢列表
     * @param articleId
     * @param userId
     * @return
     */
    List<Favourite> getByArticleIdAndUserId(Long articleId, Long userId);

    /**
     *  取消文章收藏、点赞
     * @param articleId
     * @param userName
     * @param actionType
     * @return
     */
    boolean remove(Long articleId, String userName, Short actionType) throws Exception;

    Integer getTotal();

    /**
     *  取消评论点赞
     * @param commentId
     * @param userName
     * @return
     */
    int removeCommentLike(Long commentId, String userName);
}
